import http from "@/utils/http"

const baseUrl = "/table_column"

export interface TableColumnDto {
    columnId: string,
    id?: string | number,
    tableId: string,
    tableColumnName: string,
    tableColumnLabel: string,
    tableColumnType: string,
    inputType: string,
    placeholder?: string,
    optionValue?: string[] | string,
    updateBy: string,
    status: number
}


/**
 * 获取数据列
 */
export function getColumn(tableId: string) {
    return http.get(`${baseUrl}/table/${tableId}`)
}

/**
 * 新增数据列
 * @param data
 */
export function addTableColumn(data: TableColumnDto) {
    return http.post(`${baseUrl}`, data)
}

/**
 * 删除数据列
 */
export function delTableColumn(id: string) {
    return http.del(`${baseUrl}/${id}`)
}
